using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The TeacherSalaryTransTableManager class is responsible for managing BO.TeacherSalaryTransTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class TeacherSalaryTransTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all TeacherSalaryTransTable objects in the database.
/// </summary>
/// <returns>A list with all TeacherSalaryTransTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
    public static TeacherSalaryTransTableList GetList(int SchoolKey)
    {
        return TeacherSalaryTransTableDB.GetList(SchoolKey);
}

/// <summary>
/// Gets a single TeacherSalaryTransTable from the database without its data.
/// </summary>
/// <param name="teacherSalaryTransKey">The TeacherSalaryTransKey of the TeacherSalaryTransTable in the database.</param>
/// <returns>A TeacherSalaryTransTable object when the TeacherSalaryTransKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherSalaryTransTable GetItem(long teacherSalaryTransKey){
return GetItem(teacherSalaryTransKey, false);
}

/// <summary>
/// Gets a single TeacherSalaryTransTable from the database.
/// </summary>
/// <param name="teacherSalaryTransKey">The TeacherSalaryTransKey of the TeacherSalaryTransTable in the database.</param>
/// <param name="getTeacherSalaryTransTableRecords">Determines whether to load all associated TeacherSalaryTransTable records as well.</param>
/// <returns>
/// A TeacherSalaryTransTable object when the TeacherSalaryTransKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherSalaryTransTable GetItem(long teacherSalaryTransKey, bool getTeacherSalaryTransTableRecords){
TeacherSalaryTransTable myTeacherSalaryTransTable = TeacherSalaryTransTableDB.GetItem(teacherSalaryTransKey);
return myTeacherSalaryTransTable;
}

/// <summary>
/// Saves a TeacherSalaryTransTable in the database.
/// </summary>
/// <param name="myTeacherSalaryTransTable">The TeacherSalaryTransTable instance to save.</param>
/// <returns>The new TeacherSalaryTransKey if the TeacherSalaryTransTable is new in the database or the existing TeacherSalaryTransKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static long Save(TeacherSalaryTransTable myTeacherSalaryTransTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
long teacherSalaryTransTableTeacherSalaryTransKey = TeacherSalaryTransTableDB.Save(myTeacherSalaryTransTable);

//  Assign the TeacherSalaryTransTable its new (or existing TeacherSalaryTransKey).
myTeacherSalaryTransTable.TeacherSalaryTransKey = teacherSalaryTransTableTeacherSalaryTransKey;

myTransactionScope.Complete();

return teacherSalaryTransTableTeacherSalaryTransKey;
}
}

/// <summary>
/// Deletes a TeacherSalaryTransTable from the database.
/// </summary>
/// <param name="myTeacherSalaryTransTable">The TeacherSalaryTransTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(TeacherSalaryTransTable myTeacherSalaryTransTable){
return TeacherSalaryTransTableDB.Delete(myTeacherSalaryTransTable.TeacherSalaryTransKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(long TeacherSalaryTransKey)
{
    return TeacherSalaryTransTableDB.Delete(TeacherSalaryTransKey);
}


#endregion

}

